/*
 * @Author: firefly717
 * @Date: 2024-06-23 14:03:12
 * @LastEditTime: 2024-06-23 15:37:56
 * @Description: 
 */

import 'dart:async';
// main函数执行过程中，会将一些任务分别加入到EventQueue和MicrotaskQueue中
void main(List<String> args) {
  print("main start");

  final future = Future(() => null);
  Future(() => print("task1"));
  Future(() => print("task2")).then((_) {
    print("task3");
    scheduleMicrotask(() {
      print("task4");
    });
  }).then((_) => print("task5"));
  future.then((value) => print("task6"));
  scheduleMicrotask(() => print("task7"));
  Future.value(3).then((_) => print("task8"));
  Future.sync(() => print('task9'));
  Future.sync(() => Future.microtask(() => print("task10")));

  print("main end");
}
